import request from '@/config/axios'

// 规格 VO
export interface JkSizeVO {
  id: number // id
  name: string // 规格名称
}

// 规格 API
export const JkSizeApi = {
  // 查询规格分页
  getJkSizePage: async (params: any) => {
    return await request.get({ url: `/jikong/jk-size/page`, params })
  },

  getJkSizeList: async () => {
    return await request.get({ url: `/jikong/jk-size/simple-list` })
  },

  // 查询规格详情
  getJkSize: async (id: number) => {
    return await request.get({ url: `/jikong/jk-size/get?id=` + id })
  },

  // 新增规格
  createJkSize: async (data: JkSizeVO) => {
    return await request.post({ url: `/jikong/jk-size/create`, data })
  },

  // 修改规格
  updateJkSize: async (data: JkSizeVO) => {
    return await request.put({ url: `/jikong/jk-size/update`, data })
  },

  // 删除规格
  deleteJkSize: async (id: number) => {
    return await request.delete({ url: `/jikong/jk-size/delete?id=` + id })
  },

  // 导出规格 Excel
  exportJkSize: async (params) => {
    return await request.download({ url: `/jikong/jk-size/export-excel`, params })
  }
}
